<!DOCTYPE html>
<html>
 <head> 
  <meta charset="UTF-8" /> 
  <title>新增app</title> 
  <link rel="stylesheet" href="../assets/plugins/layui/css/layui.css" media="all" /> 
  <link rel="stylesheet" href="../assets/css/global.css" media="all" /> 
 </head> 
 <body> 
  <div class="admin-main">  
   <form class="layui-form" action="../admin/app/add">
        <div class="layui-form-item">
			<label class="layui-form-label">应用名称</label>
			<div class="layui-input-block" style="width: 600px;">
				<input type="text" name="name" placeholder="中文名称" required lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">应用标识</label>
			<div class="layui-input-block" style="width: 600px;">
				<input type="text" name="code" placeholder="应用标识" required lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">是否多模块</label>
			<div class="layui-input-inline" style="width: 180px;">
			   <input type="radio" name="isModule" value="true" title="否" lay-filter="isModule">
               <input type="radio" name="isModule" value="false" title="是" checked lay-filter="isModule">
			</div>
			<div class="layui-form-mid layui-word-aux">多模块项目可以添加子模块</div>
		</div>
	   <div class="layui-form-item">
		   <label class="layui-form-label">业务组</label>
		   <div class="layui-input-block">
			   <ul id="groupList" templateLoad="../admin/group/options" template-id="checklist_tpl" onFinishCallback="onFinishCallback"></ul>
			   <script type="text/html" id="checklist_tpl">
				   {{# layui.each(d, function(index, item){ }}
                   {{#  if(top.currentUser.superAdmin){ }}
				   <span><input type="radio" name="groupId" lay-verify="required" lay-skin="primary" title="{{ item.text }}" value="{{ item.value }}" /></span>
                   {{#  } else{ }}
                   <span><input type="radio" name="groupId" lay-verify="required" lay-skin="primary" title="{{ item.text }}" value="{{ item.value }}" {{top.currentUser.groupId.toString() === item.value ? 'checked' : 'disabled'}} /></span>
                   {{#  } }}
				   {{# }); }}
			   </script>
		   </div>
	   </div>
		<div class="layui-form-item" id="master_div">
			<label class="layui-form-label">负责人</label>
			<div class="layui-input-block" style="width: 600px;"> 
             <select id="masterUid" name="ownerId" asnycSelect="../admin/user/options" lay-filter="masterUid_select"> 
               <option value="">请选择负责人</option> 
             </select> 
            </div>
		</div>
		<div class="layui-form-item"> 
          <div class="layui-input-block"> 
           <input type="button"  class="layui-btn layui-btn-normal J_ajaxSubmit" onSuccessCallback="reload" value="保存"/>
           <input type="reset" class="layui-btn layui-btn-primary" value="重置"/>
          </div> 
       </div> 
	</form>
  </div> 
  <script type="text/javascript" src="../assets/plugins/layui/layui.js"></script> 
  <script type="text/javascript">
  layui.config({
	  base: '/assets/js/'
 }).use(['jeesuitelayui','form'], function(){
	 if(!top.currentUser.superAdmin){
		 layui.jquery('#master_div').hide();
	 }
 });
  function onFinishCallback(){
	  layui.form.render();
  }
	
  </script>
 </body>
</html>